package com.zhongxi.guoyuan.adapter.beautifulStore;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

import com.zhongxi.guoyuan.view.beautifulStore.BeautifulFragmentFactory;

/**
 * Created by Administrator on 2017/10/17.
 */

public class BeautifulProjectAdapter extends FragmentStatePagerAdapter {
    private String trim;

    public BeautifulProjectAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        String title = "最新";
        switch (position) {
            case 0:
                title = "最新";
                break;
            case 1:
                title = "最惠";
                break;
            case 2:
                title = "最赞";
                break;
        }
        return title;
    }

    @Override
    public Fragment getItem(int position) {
        return BeautifulFragmentFactory.create(position, trim);
    }

    @Override
    public int getItemPosition(Object object) {
        return POSITION_NONE;
    }

    @Override
    public int getCount() {
        return 3;
    }

    public void setPrimary(String trim) {
        this.trim = trim;
    }
}
